<?php
$sql = 'SELECT * 
FROM  `bukhari_books`';
$query = $db->query($sql);
$title = 'Sahih Bukhari';

//$sql = 'SELECT * FROM  `bukhari` 
//    LEFT JOIN `bukhari_books` ON `bukhari`.`book_id` = `bukhari_books`.`id`
//    LEFT JOIN `bukhari_narrators` ON `bukhari`.`narrator` = `bukhari_narrators`.`narrator_id`
//    LIMIT 0 , 30';
//$query = $db->query($sql);

//foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $result) {
//    echo '<p>' . $result['book_name'] . '</p>';
//    echo '<p>Narrated By: ' . $result['narrator_name'] . '</p>';
//    echo '<p>' . $result['full_text'] . '</p>';
//}

include './app/layout/header.php';
?>
<div class="section_w670">
    <h2>Sahih Bukhari</h2>
</div>
<div class="cleaner_h10"></div>
<div class="section_w670">
<?php
foreach ($query->fetchAll(PDO::FETCH_ASSOC) as $result) {
    echo '<p><a href="/bukhari/book/' . $result['id'] . '">' . $result['id'] . '. ' . $result['book_name'] . '</a></p>';
}
?>
</div>
<div class="cleaner_h10"></div>
<?php
include './app/layout/footer.php';